<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>The quantizeimages purpose</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="gmagick.quantizeimage.html">Gmagick::quantizeimage</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="gmagick.queryfontmetrics.html">Gmagick::queryfontmetrics</a></div>
 <div class="up"><a href="class.gmagick.html">Gmagick</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="gmagick.quantizeimages" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">Gmagick::quantizeimages</h1>
  <p class="verinfo">(PECL gmagick &gt;= Unknown)</p><p class="refpurpose"><span class="refname">Gmagick::quantizeimages</span> &mdash; <span class="dc-title">The quantizeimages purpose</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-gmagick.quantizeimages-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type"><span class="type void">void</span></span> <span class="methodname"><strong>Gmagick::quantizeimages</strong></span>
    ( <span class="methodparam"><span class="type">int</span> <code class="parameter">$numColors</code></span>
   , <span class="methodparam"><span class="type">int</span> <code class="parameter">$colorspace</code></span>
   , <span class="methodparam"><span class="type">int</span> <code class="parameter">$treeDepth</code></span>
   , <span class="methodparam"><span class="type">bool</span> <code class="parameter">$dither</code></span>
   , <span class="methodparam"><span class="type">bool</span> <code class="parameter">$measureError</code></span>
   )</div>

  <p class="para rdfs-comment">
   Analyzes the colors within a sequence of images and chooses a fixed number of 
   colors to represent the image. The goal of the algorithm is to minimize the 
   color difference between the input and output image while minimizing the processing time.
  </p>

   

 </div>


 <div class="refsect1 parameters" id="refsect1-gmagick.quantizeimages-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   <dl>

    
     <dt>
<em><code class="parameter">numColors</code></em></dt>

     <dd>

      <p class="para">
       The number of colors.
      </p>
     </dd>

    
    
     <dt>
<em><code class="parameter">colorspace</code></em></dt>

     <dd>

      <p class="para">
       Perform color reduction in this colorspace, typically RGBColorspace.
      </p>
     </dd>

    
    
     <dt>
<em><code class="parameter">treeDepth</code></em></dt>

     <dd>

      <p class="para">
       Normally, this integer value is zero or one. A zero or one tells Quantize 
to choose a optimal tree depth of Log4(number_colors).% A tree of this depth generally 
allows the best representation of the reference image with the least amount of memory
 and the fastest computational speed. In some cases, such as an image with low color
 dispersion (a few number of colors), a value other than Log4(number_colors) is required. 
To expand the color tree completely, use a value of 8.
      </p>
     </dd>

    
    
     <dt>
<em><code class="parameter">dither</code></em></dt>

     <dd>

      <p class="para">
       A value other than zero distributes the difference between an original image and the corresponding color reduced algorithm to neighboring pixels along a Hilbert curve.
      </p>
     </dd>

    
    
     <dt>
<em><code class="parameter">measureError</code></em></dt>

     <dd>

      <p class="para">
       A value other than zero measures the difference between the original and quantized images. This difference is the total quantization error. The error is computed by summing over all pixels in an image the distance squared in RGB space between each reference pixel value and its quantized value.
      </p>
     </dd>

    
   </dl>

  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-gmagick.quantizeimages-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   The Gmagick object on success
  </p>
 </div>


  <div class="refsect1 errors" id="refsect1-gmagick.quantizeimages-errors">
  <h3 class="title">错误／异常</h3>
  <p class="para">
   错误时抛出
<strong class="classname">GmagickException</strong>。
  </p>
 </div>

</div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="gmagick.quantizeimage.html">Gmagick::quantizeimage</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="gmagick.queryfontmetrics.html">Gmagick::queryfontmetrics</a></div>
 <div class="up"><a href="class.gmagick.html">Gmagick</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
